<?php include_once('header.php'); ?>
<?php include_once('left_navigation.php'); ?>
<?php
	include('../classess/class_affiliate_user.php');
?>
<div class="col-lg-12"><!-- Start Middle Content Div-->
	<div class="box">
		<div class="row">
			<div class="col-lg-12" style="margin-top:-20px; text-align:center;">
                <div class="box" style="font-size:16px;">
					Your Refrence URL is 
					<a href="<?php echo ReferenceLink; ?>" target="_blank" style="text-decoration:none; color:blue; "><?php echo ReferenceLink; ?></a>	
                </div>
            </div>
			<div class="col-lg-12">
				<div class="box">
					<div class="box-header" data-original-title>
						<h2><i class="fa fa-user"></i><span class="break"></span>Affiliate Users</h2>
						<div class="box-icon">
							<a href="table.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a>
							<a href="table.html#" class="btn-close"><i class="fa fa-times"></i></a>
						</div>
					</div>
					<div class="box-content">						
						<?php
							$sel_course = "SELECT * FROM tbl_courses where is_active = '1'";
							$query_courses = mysql_query($sel_course) or die(mysql_error());

							if(mysql_num_rows($query_courses)){
								while($row = mysql_fetch_array($query_courses)){
									$crsimg_ext = $row['course_image'];
									$temp = explode(".", $crsimg_ext);
									$extension = end($temp);
						?>
						<div class="row" style="padding:20px 40px;">
							<div class="fl_left" style="border:1px solid black; width:21%;">
								<img src="../../admin/dashboard/course_image/<?php echo $row['id'].'/'.$row['id'].'.'.$extension; ?>" alt="" style="width:100%; height:140px;" />
							</div>
							<div class="fl_left" style="width:79%; text-align:right;">									
								<textarea style="height:140px; width:70%;" readonly	>
									<iframe style="width:100%; height:100%;" src="http://rvtraining.net/referred_courses.php?dif_id=<?php echo $_SESSION['user_reference_id'].'.'.$row['id'] ?>" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
								</textarea>
							</div>
							<div class="clear_fix" style="clear:both;"></div>
						</div>
						<?php
								}
							}
						?><hr/>
						<h2>Ebook</h2>
						<?php
							$sel_course = "SELECT * FROM tbl_ebook where ebook_is_active = '1'";
							$query_courses = mysql_query($sel_course) or die(mysql_error());

							if(mysql_num_rows($query_courses)){
								while($row = mysql_fetch_array($query_courses)){
									$crsimg_ext = $row['ebook_image'];
									$temp = explode(".", $crsimg_ext);
									$extension = end($temp);
						?>
						<div class="row" style="padding:20px 40px;">
							<div class="fl_left" style="border:1px solid black; width:21%;">
								<img src="../../admin/dashboard/ebook_images/<?php echo $row['id'].'/'.$row['id'].'.'.$extension; ?>" alt="" style="width:100%; height:140px;" />
							</div>
							<div class="fl_left" style="width:79%; text-align:right;">									
								<textarea style="height:140px; width:70%;" readonly	>
									<iframe style="width:100%; height:100%;" src="http://rvtraining.net/referred_courses.php?dif_id=<?php echo $_SESSION['user_reference_id'].'.'.$row['id'] ?>&ebk_chk=1" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
								</textarea>
							</div>
							<div class="clear_fix" style="clear:both;"></div>
						</div>
						<?php
								}
							}
						?>
					</div>
				</div>
			</div><!--/col-->

		</div><!--/row-->

	</div><!-- End Box Div-->
</div><!-- End Middle Content Div-->
<?php include_once('footer.php'); ?>
<script>
	$ = jQuery.noConflict();
	$(document).ready(function(){	
		$('.close').click(function(){
			$('.alert-info').addClass('hide');
		});

		$('#submit_course_search').click(function(){
			document.search_course_form.submit()
		});
	});
		
	
</script>